package com.sx.gongzhong.pest;

import com.sx.gongzhong.model.HeadParamBean;
import com.sx.gongzhong.model.ReplyUserBean;
import com.sx.gongzhong.net.BaseCallBack;
import com.sx.gongzhong.net.LegalAdviceManager;
import com.sx.gongzhong.view.IVoidView;

import java.util.Map;

/**法律咨询 添加
 * Created by admin on 2018/1/12.
 */

public class LegalAdviceAddPest {
    private IVoidView iVoidView;

    public LegalAdviceAddPest(IVoidView iVoidView) {
        this.iVoidView = iVoidView;
    }

    public void addLegalAdvice(String advisoryTypeId, String content) {
        Map<String,Object> map = HeadParamBean.getHead();
        map.put("advisoryTypeId",advisoryTypeId);
        map.put("content",content);
        new LegalAdviceManager().addLegalAdvice(map, new BaseCallBack<ReplyUserBean.BaseResult<Void>>() {
            @Override
            public void onSuccess(ReplyUserBean.BaseResult<Void> response) {
                iVoidView.voidView("提交成功");
            }
            @Override
            public void onFailures(String message) {
                iVoidView.showError(message);
            }
        });
    }
}
